home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / gnulib / sipp / libsipp / mask.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-17  |  1.4 KB  |  46 lines

  1. /**
  2.  ** sipp - SImple Polygon Processor
  3.  **
  4.  **  A general 3d graphic package
  5.  **
  6.  **  Copyright Equivalent Software HB  1992
  7.  **
  8.  ** This program is free software; you can redistribute it and/or modify
  9.  ** it under the terms of the GNU General Public License as published by
  10.  ** the Free Software Foundation; either version 1, or any later version.
  11.  ** This program is distributed in the hope that it will be useful,
  12.  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  ** GNU General Public License for more details.
  15.  ** You can receive a copy of the GNU General Public License from the
  16.  ** Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  **/
  18.  
  19. /**
  20.  ** mask.c - Mask shader: use a masking function to select between 
  21.  **          two shaders.
  22.  **/
  23.  
  24. #include <sipp.h>
  25. #include <shaders.h>
  26.  
  27. void
  28. mask_shader(pos, normal, texture, view_vec, lights, md, color, opacity)
  29.     Vector      *pos;
  30.     Vector      *normal;
  31.     Vector      *texture;
  32.     Vector      *view_vec;
  33.     Lightsource *lights;
  34.     Mask_desc   *md;
  35.     Color       *color;
  36.     Color       *opacity;
  37. {
  38.     if (md->masker(md->mask_data, texture)) {
  39.         md->t_shader(pos, normal, texture, view_vec, lights, md->t_surface, 
  40.                      color, opacity); 
  41.     } else {
  42.         md->f_shader(pos, normal, texture, view_vec, lights, md->f_surface, 
  43.                      color, opacity); 
  44.     }
  45. }
  46.